package com.augurit.wf.mgmt.web.form;

import java.sql.Clob;
import java.text.DateFormat;
import java.util.Date;

import com.augurit.common.base.form.BaseForm;
import com.augurit.wf.common.entity.Jbpm4Variable;

public class Jbpm4VariableForm extends BaseForm{
	
	private Long dbid;
	private String clazz;
	private Long dbversion;
	private String key;
	private String converter;
	private Long hist;
	private Long executionDbid;
	private Long taskId;
	private Long lob;
	private Date dateValue;
	private Double doubleValue;
	private String className;
	private Long longValue;
	private String stringValue;
	private Clob clobValue;
	private Long exesys;
	
	//扩展
	private String value;
	private String procInstId;
	
	public Jbpm4VariableForm(){}
	
	public Jbpm4VariableForm(Jbpm4Variable entity){
		this.dbid = entity.getDbid();
		this.key = entity.getKey();
		this.executionDbid = entity.getExecutionDbid();
		this.clazz = entity.getClazz();
		this.dbversion = entity.getDbversion();
		
		if(entity.getDateValue() != null)
			this.value = DateFormat.getDateInstance().format(entity.getDateValue());
		else if(entity.getDoubleValue() != null)
			this.value = entity.getDoubleValue().toString();
		else if(entity.getLongValue() != null)
			this.value = entity.getLongValue().toString();
		else if(entity.getStringValue() != null)
			this.value = entity.getStringValue();
		else if(entity.getClobValue() != null)
			this.value = "Clob类型_" +entity.getClobValue().toString();
	}

	public Long getDbid() {
		return dbid;
	}

	public void setDbid(Long dbid) {
		this.dbid = dbid;
	}

	public String getClazz() {
		return clazz;
	}

	public void setClazz(String clazz) {
		this.clazz = clazz;
	}

	public Long getDbversion() {
		return dbversion;
	}

	public void setDbversion(Long dbversion) {
		this.dbversion = dbversion;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public String getConverter() {
		return converter;
	}

	public void setConverter(String converter) {
		this.converter = converter;
	}

	public Long getHist() {
		return hist;
	}

	public void setHist(Long hist) {
		this.hist = hist;
	}

	public Long getExecutionDbid() {
		return executionDbid;
	}

	public void setExecutionDbid(Long executionDbid) {
		this.executionDbid = executionDbid;
	}

	public Long getTaskId() {
		return taskId;
	}

	public void setTaskId(Long taskId) {
		this.taskId = taskId;
	}

	public Long getLob() {
		return lob;
	}

	public void setLob(Long lob) {
		this.lob = lob;
	}

	public Date getDateValue() {
		return dateValue;
	}

	public void setDateValue(Date dateValue) {
		this.dateValue = dateValue;
	}

	public Double getDoubleValue() {
		return doubleValue;
	}

	public void setDoubleValue(Double doubleValue) {
		this.doubleValue = doubleValue;
	}

	public String getClassName() {
		return className;
	}

	public void setClassName(String className) {
		this.className = className;
	}

	public Long getLongValue() {
		return longValue;
	}

	public void setLongValue(Long longValue) {
		this.longValue = longValue;
	}

	public String getStringValue() {
		return stringValue;
	}

	public void setStringValue(String stringValue) {
		this.stringValue = stringValue;
	}

	public Clob getClobValue() {
		return clobValue;
	}

	public void setClobValue(Clob clobValue) {
		this.clobValue = clobValue;
	}

	public Long getExesys() {
		return exesys;
	}

	public void setExesys(Long exesys) {
		this.exesys = exesys;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public String getProcInstId() {
		return procInstId;
	}

	public void setProcInstId(String procInstId) {
		this.procInstId = procInstId;
	}
}
